/* ****************************************************************
   ****************************************************************
   * Com++ Professional (c) 2009 C++ World
   * http://www.cplusplusworld.com/ mailto:compp@cplusplusworld.com
   ****************************************************************
   ****************************************************************
*/

#ifndef _DIRECTORY_H
#define _DIRECTORY_H


#include <string>
#include <list>
#include <iterator>
#include "ComPlusPlus/DirEntry.h"
#include "SysPlusPlus/ComException.h"

namespace compp {

class Directory {

public:
	Directory();
	Directory( const std::string & Path,  const std::string & Filter = "" );

	virtual ~Directory();

	void setPath( const std::string & Path,  const std::string &  Filter = "" );
	std::list<compp::DirEntry>::iterator getFirst();	
	std::list<compp::DirEntry>::iterator end();
	void Refresh();
	void SortName();
	void setSortAsc();
	void setSortDesc();

protected:
	std::list<compp::DirEntry> DirectoryList;
	std::list<compp::DirEntry>::iterator DirectoryIrritator;
	bool SortModesAsc;

	void CreateListing(const std::string & s, const std::string &  Filter = "");
	std::string DirPath;

};

}
#endif

